﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;

namespace Web_HengliSeed.en_us
{
    public partial class Information : PageBase
    {
        public string Content = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            using (OleDbDataReader red = BLL.Information.GetInformation(Request["action"], language))
            {
                if (red != null)
                {
                    while (red.Read())
                    {
                        Content = Server.HtmlDecode(red["T_Content"].ToString());
                    }
                    red.Close();
                }
            }
        }

        public string GetTitle()
        {
            switch (Request["action"].ToLower())
            {
                case "about1":
                    return "Message from the President";
                case "about2":
                    return "About Us";
                case "about3":
                    return "Organization";
                case "about4":
                    return "Development plan";
                case "about5":
                    return "Honor";
                case "about6":
                    return "Corporate culture";
                case "about7":
                    return "Contact Us";
                case "about8":
                    return "Talent Strategy";
                case "service":
                    return "Customer Service";
                case "job":
                    return "Talent Strategy";
                case "jobs":
                    return "Jobs";
                default:
                    return string.Empty;
            }
        }

        public string GetList()
        {
            string str = string.Empty;
            if (Request["action"] == "service")
            {
//                str = @"<li class='active'><a href='#'>Service</a>
//                            <ul>
//                                <li><a href='Information.aspx?action=service'><strong>Service</strong></a></li>
//                                <li><a href='Guestbook.aspx'><strong>Guestbook</strong></a></li>
//                            </ul></li>";
            }
            else if (Request["action"] == "job" || Request["action"] == "jobs")
            {
                str = @"<li class='active'><a href='#'>Jobs</a>
                            <ul>
                                <li><a href='Information.aspx?action=job'><strong>Talent Strategy</strong></a></li>
                                <li><a href='Information.aspx?action=jobs'><strong>Jobs</strong></a></li>
                            </ul></li>";
            }
            else
            {
                str = @"<li class='active'><a href='#'>About</a>
                            <ul>
                                <li><a href='Information.aspx?action=about1'><strong>Message from the President</strong></a></li>
                                <li><a href='Information.aspx?action=about2'><strong>About Us</strong></a></li>
                                <li><a href='Information.aspx?action=about3'><strong>Organization</strong></a></li>
                                <li><a href='Information.aspx?action=about4'><strong>Development plan</strong></a></li>
                                <li><a href='Information.aspx?action=about5'><strong>Honor</strong></a></li>
                                <li><a href='Information.aspx?action=about6'><strong>Corporate culture</strong></a></li>
                                <li><a href='Information.aspx?action=about7'><strong>Contact Us</strong></a></li>
                                <li><a href='Guestbook.aspx'><strong>Guestbook</strong></a></li>
                            </ul></li>";
            }
            return str;
        }
    }
}